<%@ page language="java" import="java.util.*,Bean.Course" pageEncoding="utf-8"%>
<html>
  <head>
    <title>课程信息管理</title>
    <style type="text/css">
   		a{
   			text-decoration: none;
   			color: red;
   		}
   	</style>
  </head>
  
  <body background="${pageContext.request.contextPath}/image/course.png" style=" background-repeat:no-repeat ;background-size:100% 100%;
		background-attachment: fixed;">
    <%
			ArrayList courseList = (ArrayList)request.getAttribute("courseList");
			
	%>
	<br>
	<div align="center" style="margin:20px auto; ">	  	
  	<form action="ShowAllCourseServlet" method="post">
  		<font size="4" color="white">课程号：</font><input type="text" name="cid">
  			<input type="submit" value="查询">
  	</form>
  	</div>
  	<p align="center">
  	<a href="/stu_info_manage_sys/addCourse.jsp" style="color: white"><font size="5">添加课程</font></a>
  	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  	<a href="/stu_info_manage_sys/index.jsp" style="color: white"><font size="5">返回首页</font></a>
  	</p><br>
	<hr><br><br>
  	<div align="center">
  		<table border="1" width="50%" style="color: white;">
		<tr align="center">
			<td>课程号</td>
			<td>课程名</td>
			<td>学时</td>
			<td>学分</td>
			<td>数据操作</td>
			<td>数据操作</td>
		</tr>
		<%
			for(int i = 0;i<courseList.size();i++){
				Course course =(Course)courseList.get(i);
		 %>
		 <tr align="center">
		 	<td><%=course.getCid()%></td>
		 	<td><%=course.getCname()%></td>
		 	<td><%=course.getCtime()%></td>
		 	<td><%=course.getCredit()%></td>
		 	<td> 
		 	<a href="/stu_info_manage_sys/updateCourse.jsp?cid=<%=course.getCid()%>
		 	&cname=<%=course.getCname()%>&ctime=<%=course.getCtime()%>
		 	&credit=<%=course.getCredit()%>">修改</a> </td>
		 	<td> <a href="/stu_info_manage_sys/servlet/DeleteCourseServlet?cid=<%=course.getCid()%>">删除</a> </td>
		 </tr>
		 <%
		 	}
		  %>
  		</table>
  	</div>
  	
  </body>
  </body>
</html>
